package org.jsola.hr.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import org.jsola.core.dto.BaseDTO;
import org.jsola.core.validator.Const;
import org.jsola.hr.constant.CustomerModuleType;

import javax.validation.constraints.NotNull;
import java.util.List;

import static org.jsola.core.example.BaseExample.*;
import static org.jsola.hr.example.CustomTemplateExample.*;

/**
 * 自定义模板
 *
 * @author zhr
 */
@EqualsAndHashCode(callSuper = true)
@ApiModel(description = "修改【自定义模板】的参数")
@Data
public class CustomTemplateUpdateDTO extends BaseDTO {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(notes = N_ID, example = E_ID, required = true)
    @NotNull(message = M_ID_NOT_NULL)
    private String id;

    @ApiModelProperty(notes = N_IS_DEFAULT, example = E_IS_DEFAULT)
    private Boolean isDefault;

    @ApiModelProperty(notes = N_IS_OPEN, example = E_IS_OPEN)
    private Boolean isOpen;

    @ApiModelProperty(notes = N_IS_ISSUE, example = E_IS_ISSUE, required = true)
    @NotNull(message = M_IS_ISSUE_NOT_NULL)
    private Boolean isIssue;

    @ApiModelProperty(notes = N_SOURCE_ID, example = E_SOURCE_ID)
    @Length(max = 32, message = M_SOURCE_ID_MAX)
    private String sourceId;

    @ApiModelProperty(notes = N_NAME, example = E_NAME, required = true)
    @NotNull(message = M_NAME_NOT_NULL)
    @Length(max = 50, message = M_NAME_MAX)
    private String name;

    @ApiModelProperty(notes = N_MODULE_NAME, example = E_MODULE_NAME, required = true)
    @NotNull(message = M_MODULE_NAME_NOT_NULL)
    @Length(max = 50, message = M_MODULE_NAME_MAX)
    private String moduleName;

    @ApiModelProperty(notes = N_MODULE_CODE, example = E_MODULE_CODE, required = true, allowableValues = CustomerModuleType.VALUES_STR)
    @NotNull(message = M_MODULE_CODE_NOT_NULL)
    @Length(max = 30, message = M_MODULE_CODE_MAX)
    @Const(constClass = CustomerModuleType.class, message = M_MODULE_CODE_ENUM_NOT_MATCH)
    private String moduleCode;

    @ApiModelProperty(notes = N_COMPANY_ID, example = E_COMPANY_ID, required = true)
    @Length(max = 32, message = M_COMPANY_ID_MAX)
    private String companyId;

    @ApiModelProperty(notes = N_EDIT_BY, example = E_EDIT_BY)
    @Length(max = 32, message = M_EDIT_BY_MAX)
    private String editBy;

    @ApiModelProperty(notes = N_TYPE, example = E_TYPE)
    private Integer type;

    @ApiModelProperty(notes = "自定义模板参数")
    private List<CustomTemplateFieldAddDTO> customFieldAddDTOList;

    @ApiModelProperty(notes = "自定义添加字段")
    private List<CompanyAdditionalFieldsAddDTO> additionalFieldsAddDTOList;


}

